VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmBasicAPVoucherMain 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   8640
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   14010
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   8715.262
   ScaleMode       =   0  'User
   ScaleWidth      =   14010
   ShowInTaskbar   =   0   'False
   Begin ITGControls.ComunionFrames ComunionFrames2 
      Height          =   4620
      Left            =   30
      Top             =   3750
      Width           =   13740
      _ExtentX        =   24236
      _ExtentY        =   8149
      FrameColor      =   4210752
      BackColor       =   16243138
      FillColor       =   16243138
      RoundedCorner   =   0   'False
      Caption         =   "Details"
      Alignment       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ThemeColor      =   5
      ColorFrom       =   16243138
      ColorTo         =   16250865
      Begin VB.CommandButton cmdStatus 
         Caption         =   "Stat&us"
         Height          =   300
         Left            =   9840
         Picture         =   "frmBasicAPVoucherMain.frx":0000
         TabIndex        =   16
         Top             =   450
         Width           =   1635
      End
      Begin VB.ComboBox cboPayment 
         Height          =   315
         ItemData        =   "frmBasicAPVoucherMain.frx":014A
         Left            =   315
         List            =   "frmBasicAPVoucherMain.frx":0154
         Style           =   2  'Dropdown List
         TabIndex        =   28
         Top             =   4020
         Visible         =   0   'False
         Width           =   1215
      End
      Begin ITGControls.ITGTab SSTab2 
         Height          =   2670
         Left            =   30
         TabIndex        =   22
         Top             =   525
         Width           =   13695
         _ExtentX        =   24156
         _ExtentY        =   4710
         TabCaption(0)   =   "     Others    "
         TabContCtrlCnt(0)=   2
         Tab(0)ContCtrlCap(1)=   "dtgOPEX"
         Tab(0)ContCtrlCap(2)=   "cboOPEX"
         TabCaption(1)   =   "    Trade    "
         TabContCtrlCnt(1)=   1
         Tab(1)ContCtrlCap(1)=   "dtgTrade"
         TabCaption(2)   =   "    Non-Trade    "
         TabContCtrlCnt(2)=   1
         Tab(2)ContCtrlCap(1)=   "dtgNonTrade"
         TabTheme        =   2
         ActiveTabBackStartColor=   16250865
         ActiveTabBackEndColor=   16243138
         InActiveTabBackStartColor=   16243138
         InActiveTabBackEndColor=   16243138
         ActiveTabForeColor=   0
         InActiveTabForeColor=   0
         BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         OuterBorderColor=   4210752
         TopLeftInnerBorderColor=   4210752
         BottomRightInnerBorderColor=   4210752
         DisabledTabBackColor=   16243138
         DisabledTabForeColor=   -2147483627
         HoverColorInverted=   4210752
         Begin MSDataGridLib.DataGrid dtgOPEX 
            Height          =   2355
            Left            =   0
            TabIndex        =   15
            Top             =   300
            Width           =   13695
            _ExtentX        =   24156
            _ExtentY        =   4154
            _Version        =   393216
            AllowUpdate     =   -1  'True
            AllowArrows     =   -1  'True
            Appearance      =   0
            BackColor       =   16777215
            ForeColor       =   -2147483641
            HeadLines       =   1
            RowHeight       =   15
            TabAcrossSplits =   -1  'True
            TabAction       =   2
            FormatLocked    =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   8
            BeginProperty Column00 
               DataField       =   "cType"
               Caption         =   "Type"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "cAcctNo"
               Caption         =   "Account No."
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   "0"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "cTitle"
               Caption         =   "Title"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "cDesc"
               Caption         =   "Description"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "nDebit"
               Caption         =   "Debit"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "nCredit"
               Caption         =   "Credit"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column06 
               DataField       =   "cReference"
               Caption         =   "Reference"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column07 
               DataField       =   "cPCcode"
               Caption         =   "Profit Center"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Button          =   -1  'True
                  ColumnWidth     =   989.858
               EndProperty
               BeginProperty Column01 
                  Button          =   -1  'True
                  Locked          =   -1  'True
                  ColumnWidth     =   1230.236
               EndProperty
               BeginProperty Column02 
                  Locked          =   -1  'True
                  ColumnWidth     =   2250.142
               EndProperty
               BeginProperty Column03 
                  ColumnWidth     =   3270.047
               EndProperty
               BeginProperty Column04 
                  Alignment       =   1
                  ColumnWidth     =   1500.095
               EndProperty
               BeginProperty Column05 
                  Alignment       =   1
                  ColumnWidth     =   1500.095
               EndProperty
               BeginProperty Column06 
                  Button          =   -1  'True
                  ColumnWidth     =   1230.236
               EndProperty
               BeginProperty Column07 
                  Button          =   -1  'True
                  Locked          =   -1  'True
               EndProperty
            EndProperty
         End
         Begin MSDataGridLib.DataGrid dtgNonTrade 
            Height          =   2355
            Left            =   -75000
            TabIndex        =   24
            Top             =   315
            Width           =   13695
            _ExtentX        =   24156
            _ExtentY        =   4154
            _Version        =   393216
            AllowUpdate     =   -1  'True
            AllowArrows     =   -1  'True
            Appearance      =   0
            HeadLines       =   1
            RowHeight       =   15
            TabAction       =   2
            FormatLocked    =   -1  'True
            AllowDelete     =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   9
            BeginProperty Column00 
               DataField       =   "cPayableID"
               Caption         =   "Payable"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "cDesc"
               Caption         =   "Description"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "dDate"
               Caption         =   "Date"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "MM/dd/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "nAmount"
               Caption         =   "Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "nApplied"
               Caption         =   "Applied Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "nEWT"
               Caption         =   "EWT"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column06 
               DataField       =   "nEVAT"
               Caption         =   "EVAT"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column07 
               DataField       =   "nEWTBase"
               Caption         =   "EWTBase"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column08 
               DataField       =   "nTaxable"
               Caption         =   "Taxable"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Button          =   -1  'True
                  ColumnWidth     =   1184.882
               EndProperty
               BeginProperty Column01 
                  ColumnWidth     =   3600
               EndProperty
               BeginProperty Column02 
                  Alignment       =   2
                  Locked          =   -1  'True
                  ColumnWidth     =   1305.071
               EndProperty
               BeginProperty Column03 
                  Alignment       =   1
                  Locked          =   -1  'True
                  ColumnWidth     =   1695.118
               EndProperty
               BeginProperty Column04 
                  Alignment       =   1
                  ColumnWidth     =   1695.118
               EndProperty
               BeginProperty Column05 
                  ColumnWidth     =   1500.095
               EndProperty
               BeginProperty Column06 
                  Object.Visible         =   0   'False
                  ColumnWidth     =   1500.095
               EndProperty
               BeginProperty Column07 
                  Object.Visible         =   0   'False
               EndProperty
               BeginProperty Column08 
                  Object.Visible         =   0   'False
               EndProperty
            EndProperty
         End
         Begin VB.ComboBox cboOPEX 
            Height          =   315
            ItemData        =   "frmBasicAPVoucherMain.frx":0162
            Left            =   375
            List            =   "frmBasicAPVoucherMain.frx":016C
            Style           =   2  'Dropdown List
            TabIndex        =   30
            Top             =   600
            Visible         =   0   'False
            Width           =   1020
         End
         Begin ITGControls.ITGTextBox ITGTextBox4 
            Height          =   285
            Left            =   -74775
            TabIndex        =   29
            Top             =   1485
            Width           =   6930
            _ExtentX        =   12012
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1325
            TextBoxWidth    =   5545
            LinkForeColor   =   0
         End
         Begin MSDataGridLib.DataGrid dtgTrade 
            Height          =   2355
            Left            =   -75015
            TabIndex        =   23
            Top             =   315
            Width           =   13740
            _ExtentX        =   24236
            _ExtentY        =   4154
            _Version        =   393216
            AllowUpdate     =   -1  'True
            AllowArrows     =   -1  'True
            Appearance      =   0
            HeadLines       =   1
            RowHeight       =   15
            TabAction       =   2
            FormatLocked    =   -1  'True
            AllowDelete     =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   6
            BeginProperty Column00 
               DataField       =   "cPINo"
               Caption         =   "Purchase Invoice"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "dDate"
               Caption         =   "Date"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "MM/dd/yyyy"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   3
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "nAmount"
               Caption         =   "Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "nApplied"
               Caption         =   "Applied Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "nEWT"
               Caption         =   "EWT"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "nEVAT"
               Caption         =   "EVAT"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Button          =   -1  'True
                  ColumnWidth     =   1769.953
               EndProperty
               BeginProperty Column01 
                  Alignment       =   2
                  Locked          =   -1  'True
                  ColumnWidth     =   1544.882
               EndProperty
               BeginProperty Column02 
                  Alignment       =   1
                  Locked          =   -1  'True
                  ColumnWidth     =   1934.929
               EndProperty
               BeginProperty Column03 
                  Alignment       =   1
                  ColumnWidth     =   1964.976
               EndProperty
               BeginProperty Column04 
                  ColumnWidth     =   1980.284
               EndProperty
               BeginProperty Column05 
                  ColumnWidth     =   1934.929
               EndProperty
            EndProperty
         End
         Begin VB.Label Label6 
            BackColor       =   &H00F7D9C2&
            Caption         =   "Currency"
            Height          =   240
            Left            =   -67335
            TabIndex        =   31
            Top             =   420
            Width           =   1305
         End
      End
      Begin MSDataGridLib.DataGrid dtgPayment 
         Height          =   1335
         Left            =   0
         TabIndex        =   25
         Top             =   3285
         Width           =   13740
         _ExtentX        =   24236
         _ExtentY        =   2355
         _Version        =   393216
         AllowUpdate     =   -1  'True
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAcrossSplits =   -1  'True
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "PAYMENT"
         ColumnCount     =   6
         BeginProperty Column00 
            DataField       =   "cType"
            Caption         =   "Type"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cBankID"
            Caption         =   "Bank ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cCheckNo"
            Caption         =   "Check Number"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cCheckBookNo"
            Caption         =   "Check Book No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "dCheckDate"
            Caption         =   "Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "nAmount"
            Caption         =   "Amount"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   1
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
               Button          =   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1170.142
            EndProperty
            BeginProperty Column01 
               Button          =   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1635.024
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   2385.071
            EndProperty
            BeginProperty Column03 
               ColumnAllowSizing=   0   'False
               Locked          =   -1  'True
               ColumnWidth     =   2009.764
            EndProperty
            BeginProperty Column04 
               ColumnWidth     =   1769.953
            EndProperty
            BeginProperty Column05 
               Alignment       =   1
               ColumnWidth     =   1920.189
            EndProperty
         EndProperty
      End
      Begin ITGControls.ITGTextBox ITGTctype 
         Height          =   285
         Left            =   5880
         TabIndex        =   32
         Top             =   3720
         Visible         =   0   'False
         Width           =   195
         _ExtentX        =   238
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Label           =   "ITGtext"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   135
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   285
      Left            =   0
      TabIndex        =   27
      Top             =   8355
      Width           =   14010
      _ExtentX        =   24712
      _ExtentY        =   503
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Bevel           =   0
            Object.Width           =   11485
            MinWidth        =   2
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin ITGControls.ITGTab SSTab1 
      Height          =   3735
      Left            =   30
      TabIndex        =   33
      Top             =   30
      Width           =   13740
      _ExtentX        =   24236
      _ExtentY        =   6588
      TabCount        =   2
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   1
      Tab(0)ContCtrlCap(1)=   "ComunionFrames1"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483627
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   3420
         Left            =   -75000
         TabIndex        =   26
         Top             =   315
         Width           =   12135
         _ExtentX        =   21405
         _ExtentY        =   6033
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   3
         BeginProperty Column00 
            DataField       =   "cTranNo"
            Caption         =   "Voucher Number"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cName"
            Caption         =   "Customer Name"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cAddress"
            Caption         =   "Address"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1695.118
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   4064.882
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   4559.811
            EndProperty
         EndProperty
      End
      Begin ITGControls.ComunionFrames ComunionFrames1 
         Height          =   3420
         Left            =   0
         Top             =   315
         Width           =   13740
         _ExtentX        =   24236
         _ExtentY        =   6033
         FrameColor      =   4210752
         BackColor       =   16243138
         FillColor       =   16243138
         RoundedCorner   =   0   'False
         Caption         =   "Payee Information"
         Alignment       =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ThemeColor      =   5
         ColorFrom       =   16243138
         ColorTo         =   16250865
         Begin VB.CommandButton cmdPickWork 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   3645
            Picture         =   "frmBasicAPVoucherMain.frx":017A
            Style           =   1  'Graphical
            TabIndex        =   8
            Top             =   1470
            Width           =   315
         End
         Begin VB.CommandButton cmdPickProject 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   3645
            Picture         =   "frmBasicAPVoucherMain.frx":02C4
            Style           =   1  'Graphical
            TabIndex        =   6
            Top             =   1170
            Width           =   315
         End
         Begin VB.CommandButton cmdPickRFP 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   5805
            Picture         =   "frmBasicAPVoucherMain.frx":040E
            Style           =   1  'Graphical
            TabIndex        =   11
            Top             =   1800
            Width           =   315
         End
         Begin VB.Timer Timer1 
            Interval        =   300
            Left            =   3645
            Top             =   450
         End
         Begin VB.ComboBox cboType 
            Height          =   315
            ItemData        =   "frmBasicAPVoucherMain.frx":0558
            Left            =   10590
            List            =   "frmBasicAPVoucherMain.frx":056B
            Style           =   2  'Dropdown List
            TabIndex        =   2
            Top             =   555
            Width           =   1585
         End
         Begin VB.CommandButton cmdPickClient 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   3645
            Picture         =   "frmBasicAPVoucherMain.frx":059F
            Style           =   1  'Graphical
            TabIndex        =   4
            Top             =   870
            Width           =   315
         End
         Begin ITGControls.ITGDateBox dtbDate 
            Height          =   285
            Left            =   6525
            TabIndex        =   1
            Top             =   555
            Width           =   1395
            _ExtentX        =   2461
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtVoucherNo 
            Height          =   285
            Left            =   690
            TabIndex        =   0
            Top             =   555
            Width           =   2955
            _ExtentX        =   5001
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Voucher Number"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   1520
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtCode 
            Height          =   285
            Left            =   690
            TabIndex        =   3
            Top             =   855
            Width           =   2940
            _ExtentX        =   4974
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Supplier"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   1505
            Required        =   -1  'True
            LinkForeColor   =   16711680
         End
         Begin ITGControls.ITGTextBox txtAddress 
            Height          =   285
            Left            =   690
            TabIndex        =   12
            Top             =   2115
            Width           =   7215
            _ExtentX        =   12515
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Address"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   5780
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtPaymentFor 
            Height          =   285
            Left            =   690
            TabIndex        =   13
            Top             =   2415
            Width           =   7215
            _ExtentX        =   12515
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Payment For"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   5780
            Required        =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtCredit 
            Height          =   285
            Left            =   9420
            TabIndex        =   21
            TabStop         =   0   'False
            Top             =   2745
            Width           =   3090
            _ExtentX        =   5239
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            DecimalPlace    =   2
            Label           =   "Total Credit"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1100
            TextBoxWidth    =   1930
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtDebit 
            Height          =   285
            Left            =   9420
            TabIndex        =   20
            TabStop         =   0   'False
            Top             =   2445
            Width           =   3090
            _ExtentX        =   5239
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            DecimalPlace    =   2
            Label           =   "Total Debit"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1100
            TextBoxWidth    =   1930
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtName 
            Height          =   285
            Left            =   3990
            TabIndex        =   17
            Top             =   855
            Width           =   3915
            _ExtentX        =   6800
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3855
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtRemarks 
            Height          =   285
            Left            =   690
            TabIndex        =   14
            Top             =   2715
            Width           =   7215
            _ExtentX        =   12515
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   5780
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtType 
            Height          =   285
            Left            =   10635
            TabIndex        =   34
            Tag             =   "cboType"
            Top             =   555
            Visible         =   0   'False
            Width           =   1140
            _ExtentX        =   1905
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Mandatory       =   -1  'True
            Label           =   "Transaction Type"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   1080
         End
         Begin ITGControls.ITGTextBox txtEVAT 
            Height          =   285
            Left            =   9420
            TabIndex        =   19
            TabStop         =   0   'False
            Top             =   2145
            Width           =   3090
            _ExtentX        =   5239
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            DecimalPlace    =   2
            Label           =   "Total EVAT"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1100
            TextBoxWidth    =   1930
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtEWT 
            Height          =   285
            Left            =   9420
            TabIndex        =   18
            TabStop         =   0   'False
            Top             =   1845
            Width           =   3090
            _ExtentX        =   5239
            _ExtentY        =   503
            BackColor       =   14737632
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            DecimalPlace    =   2
            Label           =   "Total EWT"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1100
            TextBoxWidth    =   1930
            Enabled         =   0   'False
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGCheckBox chkRFP 
            Height          =   300
            Left            =   690
            TabIndex        =   9
            Top             =   1800
            Width           =   1620
            _ExtentX        =   2858
            _ExtentY        =   529
            BackColor       =   16243138
            Caption         =   "With RFP"
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            SendKeysTab     =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtRFPNo 
            Height          =   285
            Left            =   4005
            TabIndex        =   10
            Top             =   1800
            Width           =   1770
            _ExtentX        =   2910
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "RFP No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   700
            TextBoxWidth    =   1010
         End
         Begin ITGControls.ITGTextBox txtProject 
            Height          =   285
            Left            =   690
            TabIndex        =   5
            Top             =   1155
            Width           =   2940
            _ExtentX        =   4974
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Project"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   1505
            Required        =   -1  'True
            LinkForeColor   =   16711680
         End
         Begin ITGControls.ITGTextBox txtProjectName 
            Height          =   285
            Left            =   3990
            TabIndex        =   72
            Top             =   1050
            Width           =   3915
            _ExtentX        =   6800
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3855
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtWork 
            Height          =   285
            Left            =   690
            TabIndex        =   7
            Top             =   1455
            Width           =   2940
            _ExtentX        =   4974
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Work"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1375
            TextBoxWidth    =   1505
            Required        =   -1  'True
            LinkForeColor   =   16711680
         End
         Begin ITGControls.ITGTextBox txtWorkDesc 
            Height          =   285
            Left            =   3990
            TabIndex        =   73
            Top             =   1350
            Width           =   3915
            _ExtentX        =   6800
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3855
            Enabled         =   0   'False
         End
         Begin VB.Label Label2 
            BackStyle       =   0  'Transparent
            Caption         =   "Date"
            Height          =   330
            Left            =   5805
            TabIndex        =   36
            Top             =   600
            Width           =   705
         End
         Begin VB.Label Label3 
            BackStyle       =   0  'Transparent
            Caption         =   "Type"
            Height          =   330
            Left            =   9420
            TabIndex        =   35
            Top             =   600
            Width           =   705
         End
      End
   End
   Begin ITGControls.ComunionFrames fraStatus 
      Height          =   5040
      Left            =   3240
      Top             =   360
      Visible         =   0   'False
      Width           =   5775
      _ExtentX        =   10186
      _ExtentY        =   8890
      FrameColor      =   4210752
      FillColor       =   16243138
      RoundedCorner   =   0   'False
      Caption         =   "Status"
      Alignment       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ThemeColor      =   5
      Begin VB.CommandButton cmdCancel 
         Caption         =   "&Cancel"
         Height          =   300
         Left            =   3060
         Picture         =   "frmBasicAPVoucherMain.frx":06E9
         TabIndex        =   38
         Top             =   4545
         Width           =   1530
      End
      Begin VB.CommandButton cmdOK 
         Caption         =   "&OK"
         Height          =   300
         Left            =   1380
         Picture         =   "frmBasicAPVoucherMain.frx":0833
         TabIndex        =   37
         Top             =   4545
         Width           =   1530
      End
      Begin ITGControls.ITGTextBox ITGcLiquidationRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   39
         Top             =   3765
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   "0"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcVouRtrndRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   40
         Top             =   4125
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcVouRlsRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   41
         Top             =   3405
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcAuditRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   42
         Top             =   3045
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcCancelledRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   43
         Top             =   2685
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcOnHoldRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   44
         Top             =   2325
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcRlsUntRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   45
         Top             =   1965
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcRlsGrpRmks 
         Height          =   285
         Left            =   3000
         TabIndex        =   46
         Top             =   1605
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcSigUntRmks2 
         Height          =   285
         Left            =   3000
         TabIndex        =   47
         Top             =   1245
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcSigGrpRmks2 
         Height          =   285
         Left            =   3000
         TabIndex        =   48
         Top             =   885
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGTextBox ITGcSigRmks1 
         Height          =   285
         Left            =   3000
         TabIndex        =   49
         Top             =   525
         Width           =   2655
         _ExtentX        =   4577
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Label           =   ""
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   2595
      End
      Begin ITGControls.ITGDateBox ITGdSigDate1 
         Height          =   285
         Left            =   1620
         TabIndex        =   50
         Top             =   525
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdSigGrpDate2 
         Height          =   285
         Left            =   1620
         TabIndex        =   51
         Top             =   885
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdSigUntDate2 
         Height          =   285
         Left            =   1620
         TabIndex        =   52
         Top             =   1245
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdRlsGrpDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   53
         Top             =   1605
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdRlsUntDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   54
         Top             =   1965
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdOnHoldDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   55
         Top             =   2325
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdCancelledDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   56
         Top             =   2685
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdAuditDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   57
         Top             =   3045
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdVouRlsDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   58
         Top             =   3405
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdLiquidationDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   59
         Top             =   3765
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin ITGControls.ITGDateBox ITGdVouRtrndDate 
         Height          =   285
         Left            =   1620
         TabIndex        =   60
         Top             =   4125
         Width           =   1305
         _ExtentX        =   2302
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
      End
      Begin VB.Label Label12 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "Returned Voucher"
         Height          =   285
         Left            =   120
         TabIndex        =   71
         Top             =   4125
         Width           =   1395
      End
      Begin VB.Label Label11 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "For Liquidation"
         Height          =   285
         Left            =   120
         TabIndex        =   70
         Top             =   3765
         Width           =   1395
      End
      Begin VB.Label Label10 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "Date Released"
         Height          =   285
         Left            =   120
         TabIndex        =   69
         Top             =   3405
         Width           =   1395
      End
      Begin VB.Label Label9 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "For Audit"
         Height          =   285
         Left            =   120
         TabIndex        =   68
         Top             =   3105
         Width           =   1395
      End
      Begin VB.Label Label8 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "Cancelled"
         Height          =   285
         Left            =   120
         TabIndex        =   67
         Top             =   2745
         Width           =   1395
      End
      Begin VB.Label Label7 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "On Hold"
         Height          =   285
         Left            =   120
         TabIndex        =   66
         Top             =   2385
         Width           =   1395
      End
      Begin VB.Label Label1 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "For Release-Unit"
         Height          =   285
         Left            =   120
         TabIndex        =   65
         Top             =   2025
         Width           =   1395
      End
      Begin VB.Label Label5 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "For Release-Grp"
         Height          =   285
         Left            =   120
         TabIndex        =   64
         Top             =   1665
         Width           =   1395
      End
      Begin VB.Label Label4 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "2nd Signatory-Unit"
         Height          =   285
         Left            =   120
         TabIndex        =   63
         Top             =   1305
         Width           =   1395
      End
      Begin VB.Label Label13 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "2nd Signatory-Grp"
         Height          =   285
         Left            =   120
         TabIndex        =   62
         Top             =   945
         Width           =   1395
      End
      Begin VB.Label Label14 
         BackColor       =   &H00809D91&
         BackStyle       =   0  'Transparent
         Caption         =   "1st Signatory"
         Height          =   285
         Left            =   120
         TabIndex        =   61
         Top             =   585
         Width           =   1395
      End
   End
End
Attribute VB_Name = "frmBasicAPVoucherMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private oPrint As New clsPrinting

Private AutoNum As New clsAutoNumber '---Added
Public MenuName As String '---Added

Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1
Private rsNonTrade As ADODB.Recordset
Private rsOPEX As ADODB.Recordset
Private rsPayment As ADODB.Recordset
Private rsTrade As ADODB.Recordset

Private connHeader As ADODB.Connection
Private connNonTrade As ADODB.Connection
Private connOPEX As ADODB.Connection
Private connPayment As ADODB.Connection
Private connTrade As ADODB.Connection

Enum eBasicVoucherMode
    Normal
    AddNewEdit
    Find
End Enum
Public Mode As eBasicVoucherMode

Public dtgName As String
Public sBit As String
Private vBM As Variant
Private sDesc As String

Private lSystemGenerated As Boolean
Public strNo As String

Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private nOPEXDebit, nOPEXCredit, nNonTrade, nTrade, nTPC, nPayment As Double
Private lSysTransDate As Boolean 'add by denz:2/17/2011 for transdate

Private Sub cboOPEX_Click()
    rsOPEX!cType = cboOPEX
End Sub

Private Sub cboOPEX_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgOPEX.Col = 0 Then
            rsOPEX!cType = cboOPEX
            cboOPEX.Visible = False
            dtgOPEX.Col = 1
            txtRemarks.SetFocus
            dtgOPEX.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboOPEX.Visible = False
    End If
End Sub

Private Sub cboOPEX_LostFocus()
    cboOPEX.Visible = False
End Sub

Private Sub cboPayment_Click()
    If dtgPayment.Col = 0 Then
        rsPayment!cType = cboPayment
    End If
End Sub

Private Sub cboPayment_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgPayment.Col = 0 Then
            rsPayment!cType = cboPayment
            cboPayment.Visible = False
            dtgPayment.Col = 1
            dtgPayment.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboPayment.Visible = False
    End If
End Sub

Private Sub cboPayment_LostFocus()
    cboPayment.Visible = False
End Sub

Private Sub cboType_Change()
'    If (txtType <> "Trade") Or (txtType <> "Non-Trade") Then
'        txtCode.Label = txtType
'    End If
 '---------------------------
    
    If txtType = "Others" Then
        txtCode.Label = "Employee|Supplier"
        chkRFP.Enabled = True
    ElseIf txtType = "Trade" Then
        txtCode.Label = "Supplier Trade"
        chkRFP.Enabled = False
    ElseIf txtType = "Non-Trade" Then
        txtCode.Label = "Supplier"
        chkRFP.Enabled = False
    End If
    tabshow
End Sub

Private Sub cboType_Click()
    txtType = Trim(cboType)
    If Mode <> AddNewEdit Then Exit Sub
    If txtType = "Others" Then
        txtCode.Label = "Employee|Supplier"
        chkRFP.Enabled = True
    ElseIf txtType = "Trade" Then
        txtCode.Label = "Supplier Trade"
        chkRFP.Enabled = False
        chkRFP.Value = Unchecked
    ElseIf txtType = "Non-Trade" Then
        txtCode.Label = "Supplier"
        chkRFP.Enabled = False
        chkRFP.Value = Unchecked
    End If
End Sub

Private Sub cboType_KeyPress(KeyAscii As Integer)
    If txtType = "Non-Trade" Then
        txtName.SetFocus
    Else
        txtCode.Label = txtType
        SendKeysTab KeyAscii
    End If
End Sub

Private Sub chkRFP_Click()

If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then
        txtRFPNo.Locked = False
        cmdPickRFP.Enabled = True
        txtCode.Locked = True
        cmdPickClient.Enabled = False
        cboType.Enabled = False
    Else
        txtRFPNo = ""
        txtRFPNo.Locked = True
        cmdPickRFP.Enabled = False
        txtCode.Locked = False
        cmdPickClient.Enabled = True
        cboType.Enabled = True
        
        If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
            Do Until rsTrade.EOF
                rsTrade.Delete
                rsTrade.MoveNext
            Loop
            
        If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
            Do Until rsNonTrade.EOF
                rsNonTrade.Delete
                rsNonTrade.MoveNext
            Loop
            
        If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
            Do Until rsOPEX.EOF
                rsOPEX.Delete
                rsOPEX.MoveNext
            Loop
    End If
End Sub

Private Sub cmdCancel_Click()
    fraStatus.Visible = False
End Sub

Private Sub cmdOK_Click()
    If Mode = AddNewEdit Then
        fraStatus.Visible = False
    Else
        fraStatus.Visible = False
        UpdateStatus
    End If
End Sub

Private Sub cmdPickClient_Click()
    If Trim(cboType) = "" Then
        MsgBox "Please select type", vbInformation, "Comunion"
        Exit Sub
    End If
    
    If lPickListActive Then Exit Sub
    If txtType.Text = "Trade" Then
        frmITGPicker.zType = QSupplier
    ElseIf txtType.Text = "Non-Trade" Then
        frmITGPicker.zType = Qsupplierall
    ElseIf txtType.Text = "Others" Then
        frmITGPicker.zType = Qemployeesupplierall 'QEmployee
    End If
    'added condition
    frmITGPicker.Condition = "where cCompanyID = '" & COID & "'"
    
    frmITGPicker.Show vbModal
    txtCode.Text = frmITGPicker.zCode
    txtName = frmITGPicker.zName
    
    If Trim(txtName) <> "" Then
        SendKeys "{Tab}"
        SendKeys "{Tab}"
    End If

End Sub

Private Sub cmdPickRFP_Click()
    If Trim(txtCode) = "" Then
        MsgBox "Please select supplier code.", vbExclamation, msgTtl
        txtCode.SetFocus
        Exit Sub
    End If
    If lPickListActive Then Exit Sub
    RepName = Trim(txtCode)
    frmITGPickList.mType = RFP_Voucher
    frmITGPickList.Show vbModal
    txtRFPNo = frmITGPickList.mCode
    If Trim(txtRFPNo) <> "" Then
    AddDetailsFromRFP (Trim(txtRFPNo))
    SendKeys "{Tab}"
    End If
End Sub

Private Sub cmdStatus_Click()
    fraStatus.Visible = True
    fraStatus.Left = 3000
    fraStatus.Top = 2000
    fraStatus.ZOrder
End Sub

Private Sub dtgList_Click()
    tabshow
End Sub

Private Sub dtgNonTrade_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    Select Case ColIndex
        Case 0
            If GetValueFrTable("cTranNo", "PAYABLES", "cTranNo = '" & Trim(dtgNonTrade.Columns(0).Text) & "'") <> "" Then
                dtgNonTrade.Columns(1).Value = GetValueFrTable("cDesc", "PAYABLES", "cTranNo = '" & Trim(dtgNonTrade.Columns(0).Text) & "'")
                dtgNonTrade.Col = 1
                SendKeys "{Tab}"
            End If
        Case 4
            ComputeTotal
    End Select
End Sub

Private Sub dtgNonTrade_ButtonClick(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    Select Case ColIndex
        Case 0
        If txtCode.Text = "" Then
            MsgBox "Fill out the supplier code.", vbInformation, "Voucher"
            Exit Sub
        End If
            RepName = Trim(txtCode)
            frmAPList.mType = Payables
            frmAPList.Show vbModal
            If frmAPList.mRefPK <> "" Then
                dtgNonTrade.Columns(0).Value = frmAPList.mRefPK
                Set rs = Nothing
                Set rs = New ADODB.Recordset
                'sSQL = "select * from PAYABLES where cTranNo = '" & Trim(frmAPList.mRefPK) & "' and cCompanyID = '" & COID & "'"
                 sSQL = "EXEC sp_PAYABLEVOUCHERBalance '" & Trim(frmAPList.mRefPK) & "' , '" & txtCode.Text & "', '" & COID & "'"
                
                rs.Open sSQL, cn, adOpenKeyset, adLockReadOnly
                If Not rs.EOF Then
                        With rsNonTrade
                            !cPayableID = rs!cTranNo
                            !cDesc = GetValueFrTable("cDesc", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !dDate = GetValueFrTable("dDate", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            '---!nAmount = rs!nAmount
                            !nAmount = rs!nDebit
                            Dim ewtrate As Double
                            Dim ewtbase As Double
                            ewtrate = GetValueFrTable("nEWTRATE", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            ewtbase = GetValueFrTable("nEWTBase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            
                            
                            '!nEWT = Round((rs!nEWTBase * (IIf(IsNull(rs!nEWTRATE), 0, rs!nEWTRATE)) / 100), 2)
                            !nEWT = Round((ewtbase * (IIf(IsNull(ewtrate), 0, ewtrate)) / 100), 2)
                            !nApplied = rs!nDebit - !nEWT
                           ' !nApplied = rs!nAmount - !nEWT
                            !nTaxable = GetValueFrTable("nTaxablebase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !nEWTBase = GetValueFrTable("nEWTBase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            '!nApplied = rs!nAmount - (rs!nAmount * IIf(IsNull(rs!nTaxRate), 0, rs!nTaxRate) / 100)
                           ' !nEWT = rs!nEWT
                        End With
                End If
            End If
            ComputeEVATEWTTotalNonTrade
            ComputeTotal
    End Select
End Sub

Private Sub dtgNonTrade_Click()
    If Mode = AddNewEdit Then dtgName = dtgNonTrade.Name
End Sub

Private Sub dtgNonTrade_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgNonTrade_GotFocus()
    dtgName = dtgNonTrade.Name
End Sub

Private Sub dtgNonTrade_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgNonTrade_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If rsNonTrade.RecordCount = 0 Then Exit Sub

    If KeyAscii = 39 Then KeyAscii = 0

    If KeyAscii = 13 Then
        Select Case dtgNonTrade.Col
            Case 0
                'sSQL = "select * from PAYABLES where cTranNo = '" & Trim(dtgNonTrade.Columns(0).Text) & "' and cCode = '" & Trim(txtCode) & " 'and cCompanyID = '" & COID & "'"
                sSQL = "EXEC sp_PAYABLEVOUCHERBalance '" & Trim(frmAPList.mRefPK) & "' , '" & txtCode.Text & "', '" & COID & "'"
                Set rs = New Recordset
                rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
                If rs.RecordCount = 0 Then
                    dtgNonTrade.Col = 0
                    dtgNonTrade_ButtonClick 0
                Else
                    With rsNonTrade
                            !cPayableID = rs!cTranNo
                            !cDesc = GetValueFrTable("cDesc", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !dDate = GetValueFrTable("dDate", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !nAmount = rs!nDebit
                            Dim ewtrate As Double
                            Dim ewtbase As Double
                            ewtrate = GetValueFrTable("nEWTRATE", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            ewtbase = GetValueFrTable("nEWTBase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !nEWT = Round((ewtbase * (IIf(IsNull(ewtrate), 0, ewtrate)) / 100), 2)
                            !nApplied = rs!nDebit - !nEWT
                            !nTaxable = GetValueFrTable("nTaxablebase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
                            !nEWTBase = GetValueFrTable("nEWTBase", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
'                        !cPayableID = rs!cTranNo
'                        !cDesc = GetValueFrTable("cDesc", "PAYABLES", "cTranNo = '" & Trim(rs!cTranNo) & "'")
'                        !dDate = rs!dDate
'                        !nAmount = rs!nAmount
'                        !nApplied = rs!nAmount - (rs!nAmount * (rs!nTaxRate / 100))
'                        !nEWT = Format((rs!nAmount * rs!nTaxRate) / 100, "#,##0.00")
                    End With
                End If
                Set rs = Nothing
            Case Else
                SendKeys "{Tab}"
            End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub dtgNonTrade_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgNonTrade.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgOpex_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    Select Case ColIndex
        Case 1
            If GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & Trim(dtgOPEX.Columns(1).Text) & "' and cType = 'Details'") <> "" Then
                dtgOPEX.Columns(2).Value = GetValueFrTable("cTitle", "ACCOUNT", "cAcctNo = '" & Trim(dtgOPEX.Columns(1).Text) & "'")
                dtgOPEX.Col = 3
                dtgOPEX.Columns(3).Value = sDesc
            ElseIf GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & Trim(dtgOPEX.Columns(1).Text) & "' and cType = 'General' ") <> "" Then
                MsgBox "General Account.", vbInformation
                dtgOPEX.Col = ColIndex
                dtgOPEX.SetFocus
                Exit Sub
            End If
        Case 3
            sDesc = dtgOPEX.Columns(3).Value
        Case 4
            ComputeTotal
        Case 5
            ComputeTotal
    End Select
End Sub

Private Sub dtgOPEX_ButtonClick(ByVal ColIndex As Integer)

    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If Trim(txtCode) = "" Then
        MsgBox "Please fill out the employee code", vbInformation
        Exit Sub
    End If
    Select Case ColIndex

    
        Case 0
            Call MoveCombo(cboOPEX, dtgOPEX, dtgOPEX.Columns(0))
            ComboLoadValue cboOPEX, Trim(dtgOPEX.Columns(0).Text)
        Case 1
            If lPickListActive Then Exit Sub
            sFilterString = Trim(dtgOPEX.Columns(1).Text)
            frmITGPicker.zType = QAccounts
            'added condition
            frmITGPicker.Condition = "where cCompanyID = '" & COID & "'"
            
            frmITGPicker.Show vbModal
            If Trim(frmITGPicker.zCode) = "" Then Exit Sub
            dtgOPEX.Columns(1).Value = Trim(frmITGPicker.zCode & " ")
            dtgOPEX.Columns(2).Value = frmITGPicker.zName & ""
            dtgOPEX.Col = 3
            dtgOPEX.Columns(3).Value = sDesc
        Case 7
            If lPickListActive Then Exit Sub
            frmITGPicker.zType = QProfitCenter
            'added condition
            frmITGPicker.Condition = "where cCompanyID = '" & COID & "'"
            frmITGPicker.Show vbModal
            dtgOPEX.Columns(7).Value = frmITGPicker.zCode
    End Select
End Sub

Private Sub dtgOPEX_Click()
    If Mode = AddNewEdit Then dtgName = dtgOPEX.Name
End Sub

Private Sub dtgOPEX_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgOPEX_GotFocus()
    dtgName = dtgOPEX.Name
End Sub

Private Sub dtgOPEX_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgOPEX_KeyPress(KeyAscii As Integer)

    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If rsOPEX.RecordCount = 0 Then Exit Sub

    If KeyAscii = 39 Then KeyAscii = 0

    If KeyAscii = 13 Then
        Select Case dtgOPEX.Col
            Case 0
                If Not cboOPEX.Visible Then dtgOPEX_ButtonClick 0
            Case 1
                If GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & Trim(dtgOPEX.Columns(1).Text) & "'") = "" Then dtgOPEX_ButtonClick (1)
            Case 3
                If dtgOPEX.Columns(0).Value = "DBM" Then
                    SendKeys "{Tab}"
                Else
                    SendKeys "{Tab}"
                    SendKeys "{Tab}"
                End If
            Case 4
                If dtgOPEX.Columns(0).Value = "DBM" Then
                    TBNewLine
                    dtgOPEX.LeftCol = 0
                Else
                    SendKeys "{Tab}"
                End If
            Case 5
                TBNewLine
                dtgOPEX.LeftCol = 0
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If

End Sub

Private Sub dtgOPEX_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If Button = 2 Then
        dtgName = dtgOPEX.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
    SortGrid dtgList, ColIndex, rsHeader
End Sub

Private Sub dtgPayment_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 5
            ComputeTotal
    End Select
End Sub

Private Sub dtgPayment_ButtonClick(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 0
            Call LoadComboValues(cboPayment, "cValue", "PARAMETER_USER", "WHERE cCompanyID = '" & COID & "' AND cType = 'PAYTYPE'", "nOrder")
            Call MoveCombo(cboPayment, dtgPayment, dtgPayment.Columns(0))
            ComboLoadValue cboPayment, Trim(dtgPayment.Columns(0).Text)
        Case 1
            If lPickListActive Then Exit Sub
            sUnitId = COID
            frmITGPickList.mType = BANKCOMP
            frmITGPickList.Show vbModal
            If Trim(frmITGPickList.mCode) = "" Then Exit Sub
            
            dtgPayment.Columns(1).Value = frmITGPickList.mCode & ""
            dtgPayment.Columns(2).Value = frmITGPickList.mRefNo & ""
            dtgPayment.Columns(3).Value = frmITGPickList.mParam & ""
            
            dtgPayment.Col = 5
            dtgPayment.Columns(5).Value = rsPayment!nAmount
    End Select
End Sub

Private Sub dtgPayment_Click()
    If Mode = AddNewEdit Then dtgName = dtgPayment.Name
End Sub

Private Sub dtgPayment_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgPayment_GotFocus()
    dtgName = dtgPayment.Name
End Sub

Private Sub dtgPayment_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgPayment_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If rsPayment.RecordCount = 0 Then Exit Sub
    
    If KeyAscii = 39 Then KeyAscii = 0
    
    If KeyAscii = 13 Then
        Select Case dtgPayment.Col
            Case 0
                If Not cboPayment.Visible Then dtgPayment_ButtonClick 0
            Case 1
                If GetValueFrTable("cBankID", "BANK", "cBankID = '" & Trim(dtgPayment.Columns(1).Text) & "'") = "" Then
                    If Trim(dtgPayment.Columns(0).Text) = "CSH" Then
                        SendKeys "{Tab}"
                        SendKeys "{Tab}"
                        SendKeys "{Tab}"
                        dtgPayment.Columns(4).Text = Format(Date, "MM/dd/yyyy")
                    Else
                        dtgPayment_ButtonClick (1)
                    End If
                End If
            Case 5
                TBNewLine
                dtgPayment.LeftCol = 0
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If
End Sub

Private Sub dtgPayment_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgPayment.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgTrade_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    Select Case ColIndex
        Case 3
            ComputeTotal
        Case 4
            ComputeEVATEWTTotal
        Case 5
            ComputeEVATEWTTotal
    End Select
End Sub

Private Sub dtgTrade_ButtonClick(ByVal ColIndex As Integer)

    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    Select Case ColIndex
        Case 0
            If Trim(txtCode) = "" Then
                MsgBox "Please fill out the supplier code.", vbInformation
                Exit Sub
            End If
        
            RepName = Trim(txtCode)
            frmARCollectionList.mSIPick = ToVoucherPI
            frmARCollectionList.Show vbModal
            ComputeEVATEWTTotal
            ComputeTotal
    End Select

End Sub

Private Sub dtgTrade_Click()
    If Mode = AddNewEdit Then dtgName = dtgTrade.Name
End Sub

Private Sub dtgTrade_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgTrade_GotFocus()
    dtgName = dtgTrade.Name
End Sub

Private Sub dtgTrade_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgTrade_KeyPress(KeyAscii As Integer)

    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If rsTrade.RecordCount = 0 Then Exit Sub

    If KeyAscii = 39 Then KeyAscii = 0

    If KeyAscii = 13 Then
        Select Case dtgTrade.Col
            Case 0
'                sSQL = "SELECT A.cWRRNo, (B.nGross - B.nPaid - B.nReturns - B.nCredit + B.nDebit) AS nBalance FROM WRR A " & _
'                        "INNER JOIN V_WRRBalanceInquiry_Voucher B ON A.cWRRNo = B.cWRRNo " & _
'                        "WHERE A.cWRRNo = '" & Trim(dtgTrade.Columns(0).Text) & "' " & _
'                        "AND A.cCompanyID = '" & COID & "' " & _
'                        "AND ((B.nGross - B.nPaid - B.nReturns - B.nCredit + B.nDebit) <> 0)"
'                Set rs = New Recordset
'                rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'                If rs.RecordCount = 0 Then
'                    dtgTrade.Col = 0
'                    dtgTrade_ButtonClick 0
'                Else
'                    rsTrade!dDate = GetValueFrTable("dDate", "WRR", "cWRRNo = '" & Trim(dtgTrade.Columns(0).Text) & "'")
'                    rsTrade!nAmount = rs!nBalance
'                    dtgTrade.Col = 3
'                    dtgTrade.Columns(3).Value = rs!nBalance
'                    rsTrade!cWRRNo = rs!cWRRNo
'                End If
'                Set rs = Nothing
            
            
            If Trim(txtCode) = "" Then
                MsgBox "Please fill out the supplier code.", vbInformation
                Exit Sub
            End If
        
            RepName = Trim(txtCode)
            frmARCollectionList.mSIPick = ToVoucherPI
            frmARCollectionList.Show vbModal
            ComputeEVATEWTTotal
            ComputeTotal
            
            
            Case 5
                TBNewLine
                dtgTrade.LeftCol = 0
            Case Else
                SendKeys "{Tab}"
        End Select
    Else
        KeyAscii = Asc(UCase(Chr(KeyAscii)))
    End If

End Sub

Private Sub dtgTrade_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then Exit Sub
    If Button = 2 Then
        dtgName = dtgTrade.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim iKey As Integer
    iKey = ToolbarIndex(KeyCode, Shift)
    If iKey <> 0 Then
        If ITGLedgerMain.tbrMain.Buttons(iKey).Enabled = True Then
            ToolbarFunction iKey
        End If
    End If
End Sub

Private Sub Form_Load()
    Set FrmName = Me
    FormSetup
    
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'BAP04'")
    
    Set rsHeader = New ADODB.Recordset
    Set rsNonTrade = New ADODB.Recordset
    Set rsOPEX = New ADODB.Recordset
    Set rsPayment = New ADODB.Recordset
    Set rsTrade = New ADODB.Recordset
    
    sSQL = "(SELECT module_id FROM erp_sec_modules WHERE link = '" & Me.Name & "')"
    Call LoadComboValues(cboType, "RefType", "ComboValueSetUp", "Where RefModule = " & sSQL & " AND Visible = 1 and cCompanyID = '" & Trim(COID) & "'")
    
    FormLocking True
    FormSearch True
    SearchObj True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True

    Mode = Find
    txtVoucherNo.Locked = False
    sDesc = ""
    
    EnableStatusControls
    
End Sub

Private Sub Form_Activate()
    TBBitReload
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
      
    Set rsHeader = Nothing
    Set rsNonTrade = Nothing
    Set rsOPEX = Nothing
    Set rsPayment = Nothing
    Set rsTrade = Nothing
    Set connHeader = Nothing
    Set connNonTrade = Nothing
    Set connOPEX = Nothing
    Set connPayment = Nothing
    Set connTrade = Nothing
    
    Set frmBasicAPVoucherMain = Nothing

    lCloseWindow = True
    
    'oForm(Me.Tag).Mode = 1
    'oForm(Me.Tag).Tag = Me.Tag
End Sub

Public Sub TBNew()
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtVoucherNo.BackColor = &HE0FFFF
    Mode = AddNewEdit

    If rsHeader.State <> adStateOpen Then
        OpenNewConnection connHeader
        OpenNewConnection connNonTrade
        OpenNewConnection connOPEX
        OpenNewConnection connPayment
        OpenNewConnection connTrade
        OpenRecordsetWithCN rsNonTrade, "*", "VOUCHER_NONTRADE", connNonTrade, "WHERE 1 = 0"
        OpenRecordsetWithCN rsOPEX, "*", "VOUCHER_OPEX", connOPEX, "WHERE 1 = 0"
        OpenRecordsetWithCN rsPayment, "*", "VOUCHER_PAYMENT", connPayment, "WHERE 1 = 0"
        OpenRecordsetWithCN rsTrade, "*", "VOUCHER_TRADE", connTrade, "WHERE 1 = 0"
        OpenRecordsetWithCN rsHeader, "*", "VOUCHER", connHeader, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else
        vBM = rsHeader.Bookmark
    End If

    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    rsHeader!dDate = Date
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    rsHeader!lRFP = False
    SSTab1.ActiveTab = 0
    txtVoucherNo.SetFocus
    txtVoucherNo.Locked = True
    
    MenuName = "AUTO_NUMBER_VOU"
    lSystemGenerated = GetValueFrTable("lAutoNo", "system_autonumber", "cCode = '" & MenuName & "'")
    If lSystemGenerated Then rsHeader!cTranNo = AutoNum.Generate_CtrlNo2("AUTO_NUMBER_VOU", Format(Now, "mm/dd/yyyy"))
    
    strNo = rsHeader!cTranNo
End Sub

Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent
    
    rsHeader.CancelBatch adAffectAll
    rsNonTrade.CancelBatch adAffectAll
    rsOPEX.CancelBatch adAffectAll
    rsPayment.CancelBatch adAffectAll
    rsTrade.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
    
    Set FrmName = Me
    FormLocking True
    
    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True, True
    Else
        RSZero
        Mode = Find
    End If

    sbRS.Panels(2) = ""
    
    SetDataSource
    SetDataField
    
    EnableStatusControls

ErrorHandler:
    cboPayment.Visible = False
    cboOPEX.Visible = False
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then
        TBUndoAll
    End If

End Sub

Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler

    GetChild
    If rsHeader.Status = adRecNew Then
        rsNonTrade.CancelBatch adAffectAll
        rsOPEX.CancelBatch adAffectAll
        rsPayment.CancelBatch adAffectAll
        rsTrade.CancelBatch adAffectAll
        rsHeader.CancelUpdate
    Else
        rsHeader.CancelBatch adAffectCurrent
        rsNonTrade.CancelBatch adAffectAll
        rsOPEX.CancelBatch adAffectAll
        rsPayment.CancelBatch adAffectAll
        rsTrade.CancelBatch adAffectAll
    End If
   
    If rsHeader.RecordCount = 0 Then RSZero
    
ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then
        TBUndoCurrent
    End If

End Sub

Public Sub TBSave()
Dim OKUpdate As Boolean
On Error GoTo ErrHandler

    lBoolean = False
    If rsHeader.Status = adRecNew Then lBoolean = True
    
    If Not MandatoryOK Then Exit Sub
 
    If rsHeader.Status = adRecNew Then

    
        If lSystemGenerated Then
            'If ChkCtrlNo(rsHeader, "AUTO_NUMBER_VOU", "VOUCHER", "cTranNo", rsHeader!cTranNo) <> rsHeader!cTranNo Then
                
            If AutoNum.Check_CtrlNo2(rsHeader, "VOUCHER", "cTranNo", rsHeader!cTranNo, MenuName, rsHeader!dDate) <> rsHeader!cTranNo Then
                
                GetChild
                
                rsHeader!cTranNo = strNo
                
                If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
                Do Until rsNonTrade.EOF
                    rsNonTrade!cTranNo = strNo
                    rsNonTrade.MoveNext
                Loop
                
                If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
                Do Until rsOPEX.EOF
                    rsOPEX!cTranNo = strNo
                    rsOPEX.MoveNext
                Loop
                
                If rsPayment.RecordCount <> 0 Then rsPayment.MoveFirst
                Do Until rsPayment.EOF
                    rsPayment!cTranNo = strNo
                    rsPayment.MoveNext
                Loop
                
                If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
                Do Until rsTrade.EOF
                    rsTrade!cTranNo = strNo
                    rsTrade.MoveNext
                Loop
                
                GetChild
            End If
        End If
    End If
    
    OKUpdate = False
    cn.BeginTrans
    connHeader.BeginTrans
    connNonTrade.BeginTrans
    connOPEX.BeginTrans
    connPayment.BeginTrans
    connTrade.BeginTrans
        
    rsHeader.UpdateBatch adAffectAll
    rsNonTrade.UpdateBatch adAffectAll
    rsOPEX.UpdateBatch adAffectAll
    rsPayment.UpdateBatch adAffectAll
    rsTrade.UpdateBatch adAffectAll
    
    cn.CommitTrans
    connHeader.CommitTrans
    connNonTrade.CommitTrans
    connOPEX.CommitTrans
    connPayment.CommitTrans
    connTrade.CommitTrans
    OKUpdate = True
    
    Set FrmName = Me
    FormLocking True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True, True
    Mode = Normal
    
    If Not InsertIntoIssued Then GoTo ErrHandler
    UpdateCheckBooklet
    
    UpdateLogFile "Voucher", Trim(txtVoucherNo), IIf(lBoolean, "Inserted", "Updated")
    
    If lBoolean = False Then ' Edit
        cn.Execute ("UPDATE VOUCHER SET dUpdated = GETDATE () WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")
    Else ' Insert
        cn.Execute ("UPDATE VOUCHER SET dUpdated = GETDATE () WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")
    End If


    If lBoolean Then
        If lSystemGenerated And strNo = rsHeader!cTranNo Then
            UpdateControlNo strNo, rsHeader!cTranNo, "AUTO_NUMBER_VOU"
            AutoNum.Update_CtrlNo2 strNo, MenuName, Format(Now, "mm/dd/yyyy")
        End If
    End If
    
    EnableStatusControls
    
    MsgBox "Record/s successfully saved.", vbInformation, msgTtl
    sbRS.Panels(2) = ""
    
ErrHandler:
    cboPayment.Visible = False
    cboOPEX.Visible = False
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        connHeader.RollbackTrans
        connNonTrade.RollbackTrans
        connOPEX.RollbackTrans
        connPayment.RollbackTrans
        connTrade.RollbackTrans
        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, msgTtl
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        rsNonTrade.Requery
        rsOPEX.Requery
        rsPayment.Requery
        rsTrade.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True, True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
            EnableStatusControls
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, msgTtl
        cn.RollbackTrans
        connHeader.RollbackTrans
        connNonTrade.RollbackTrans
        connOPEX.RollbackTrans
        connPayment.RollbackTrans
        connTrade.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name
    End If
    
End Sub

Public Sub TBEdit()
    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Edit is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved. Edit is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    Set FrmName = Me
    FormLocking False
    ClrRequired &HC0&
    txtVoucherNo.Locked = True
    SSTab1.ActiveTab = 0
    dtbDate.SetFocus
    vBM = rsHeader.Bookmark
    
    MenuName = "AUTO_NUMBER_VOU"
    lSysTransDate = GetValueFrTable("lTransDate", "system_autonumber", "cCode = '" & MenuName & "' ") 'add by denz:2/17/2011
    If lSysTransDate Then
        dtbDate.Enabled = True
    Else: dtbDate.Enabled = False
    End If
End Sub

Public Sub TBDelete()
On Error GoTo ErrorHandler

    sID = Trim(txtVoucherNo)
    
    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Deletion is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved. Deletion is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub

    UpdateGLA "Delete", "VOU", Trim(txtVoucherNo)
    
    GetChild
    If rsNonTrade.RecordCount <> 0 Then
        rsNonTrade.MoveFirst
        Do Until rsNonTrade.RecordCount = 0
            rsNonTrade.Delete adAffectCurrent
            If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
        Loop
    End If
    If rsOPEX.RecordCount <> 0 Then
        rsOPEX.MoveFirst
        Do Until rsOPEX.RecordCount = 0
            rsOPEX.Delete adAffectCurrent
            If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
        Loop
    End If
    If rsPayment.RecordCount <> 0 Then
        rsPayment.MoveFirst
        Do Until rsPayment.RecordCount = 0
            rsPayment.Delete adAffectCurrent
            If rsPayment.RecordCount <> 0 Then rsPayment.MoveFirst
        Loop
    End If
    
    If rsTrade.RecordCount <> 0 Then
        rsTrade.MoveFirst
        Do Until rsTrade.RecordCount = 0
            rsTrade.Delete adAffectCurrent
            If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
        Loop
    End If
    
    UpdateLogFile "Voucher", Trim(txtVoucherNo), "Deleted"

    rsHeader.Delete adAffectCurrent
    
    rsNonTrade.UpdateBatch adAffectAll
    rsOPEX.UpdateBatch adAffectAll
    rsPayment.UpdateBatch adAffectAll
    rsTrade.UpdateBatch adAffectAll
    rsHeader.UpdateBatch adAffectAll
    
    TBPrevRec

    Mode = Normal

    If rsHeader.RecordCount = 0 Then
        RSZero
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        cn.Execute "DELETE VOUCHER_NonTrade WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE VOUCHER_OPEX WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE VOUCHER_PAYMENT WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE VOUCHER_TPC WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE VOUCHER_TRADE WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE VOUCHER WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        Resume Next
    End If

End Sub

Public Sub TBFind()
    Mode = Normal
    txtVoucherNo.Locked = True
    frmITGSearch.Show
End Sub

Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
        
    OpenNewConnection connHeader
    OpenNewConnection connNonTrade
    OpenNewConnection connOPEX
    OpenNewConnection connPayment
    OpenNewConnection connTrade
    
    Set rsHeader = Nothing
    Set rsNonTrade = Nothing
    Set rsOPEX = Nothing
    Set rsPayment = Nothing
    Set rsTrade = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsNonTrade = New ADODB.Recordset
    Set rsOPEX = New ADODB.Recordset
    Set rsPayment = New ADODB.Recordset
    Set rsTrade = New ADODB.Recordset

    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtVoucherNo.Locked = False
        txtVoucherNo.SetFocus
        Exit Sub
    End If
            
    OpenRecordsetWithCN rsHeader, "*", "VOUCHER", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
    OpenRecordsetWithCN rsNonTrade, "*", "VOUCHER_NonTrade", connNonTrade, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM VOUCHER WHERE " & sTemp & ")")
    OpenRecordsetWithCN rsOPEX, "*", "VOUCHER_OPEX", connOPEX, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM VOUCHER WHERE " & sTemp & ")")
    OpenRecordsetWithCN rsPayment, "*", "VOUCHER_PAYMENT", connPayment, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM VOUCHER WHERE " & sTemp & ")")
    OpenRecordsetWithCN rsTrade, "*", "VOUCHER_TRADE", connTrade, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM VOUCHER WHERE " & sTemp & ")")
    
    Set FrmName = Me
    FormLocking True
    EnableStatusControls

    If rsHeader.RecordCount = 0 Then
        FormWaitHide
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        FormSearch True
        SearchObj True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtVoucherNo.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True, True

    FormWaitHide
Else
    RSZero
    FormSearch True
    SearchObj True
    Mode = Find
   
End If
End Sub

Public Sub TBAccountAffected()
Dim lApproved As Integer
lApproved = GetValueFrTable("lApproved", "VOUCHER", "cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")
    If lApproved = 0 Then
            MsgBox "Transaction was not approved.", vbExclamation, msgTtl
            Exit Sub
    End If
    RepName = "VOU"
    frmAccountAffected.mModuleType = KVOUCHER
    frmAccountAffected.mRefPK = txtVoucherNo.Text
    frmAccountAffected.Show vbModal
End Sub

Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, True, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
    dtgName = dtgPayment.Name
End Sub

Public Sub TBCloseWindow()
    Unload Me
End Sub

Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader

End Sub

Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader

End Sub

Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader

End Sub

Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader

End Sub

Public Sub TBNewLine()
    
    If rsHeader!cTranNo = "" Then Exit Sub
    
    If dtgName = "dtgNonTrade" Then
        rsNonTrade.AddNew
        rsNonTrade!cCompanyID = COID
        rsNonTrade!cTranNo = Trim(rsHeader!cTranNo)
        rsNonTrade!dDate = Date
        rsNonTrade!nAmount = 0
        dtgNonTrade.Col = 0
        dtgNonTrade.Columns(0).Value = ""
        GetChild
        If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveLast
        dtgNonTrade.SetFocus
    ElseIf dtgName = "dtgOPEX" Then
        rsOPEX.AddNew
        rsOPEX!cCompanyID = COID
        rsOPEX!cTranNo = Trim(rsHeader!cTranNo)
        rsOPEX!nDebit = 0
        rsOPEX!nCredit = 0
        dtgOPEX.Col = 0
        dtgOPEX.Columns(0).Value = ""
        GetChild
        If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveLast
        dtgOPEX.SetFocus
    ElseIf dtgName = "dtgTrade" Then
        rsTrade.AddNew
        rsTrade!cCompanyID = COID
        rsTrade!cTranNo = Trim(rsHeader!cTranNo)
        rsTrade!dDate = Date
        dtgTrade.Col = 0
        dtgTrade.Columns(0).Value = ""
        GetChild
        If rsTrade.RecordCount <> 0 Then rsTrade.MoveLast
        dtgTrade.SetFocus
    ElseIf dtgName = "dtgPayment" Then
        rsPayment.AddNew
        rsPayment!cCompanyID = COID
        rsPayment!cTranNo = Trim(rsHeader!cTranNo)
        rsPayment!dCheckDate = Date
        dtgPayment.Col = 0
        dtgPayment.Columns(0).Value = ""
        GetChild
        If rsPayment.RecordCount <> 0 Then rsPayment.MoveLast
        dtgPayment.SetFocus
    End If
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True

End Sub

Public Sub TBDeleteLine()
On Error GoTo ErrorHandler

    If dtgName = dtgNonTrade.Name Then
        If rsNonTrade.RecordCount = 0 Then Exit Sub
        vBookMark = dtgNonTrade.Bookmark
        GetChild
        dtgNonTrade.Bookmark = vBookMark
        rsNonTrade.Delete adAffectCurrent
    ElseIf dtgName = dtgOPEX.Name Then
        If rsOPEX.RecordCount = 0 Then Exit Sub
        vBookMark = dtgOPEX.Bookmark
        GetChild
        dtgOPEX.Bookmark = vBookMark
        rsOPEX.Delete adAffectCurrent
    ElseIf dtgName = dtgTrade.Name Then
        If rsTrade.RecordCount = 0 Then Exit Sub
        vBookMark = dtgTrade.Bookmark
        GetChild
        dtgTrade.Bookmark = vBookMark
        rsTrade.Delete adAffectCurrent
    ElseIf dtgName = dtgPayment.Name Then
        If rsPayment.RecordCount = 0 Then Exit Sub
        vBookMark = dtgPayment.Bookmark
        GetChild
        dtgPayment.Bookmark = vBookMark
        rsPayment.Delete adAffectCurrent
    End If
    ComputeTotal
    GetChild

    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

    MsgBox "Unavailable on " & Me.Name

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

Public Sub TBPostRecord()
On Error GoTo TheSource
    
    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Approval is not allowed", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If CDbl(txtDebit) <> CDbl(txtCredit) Then
        MsgBox "Unbalanced transactions cannot be approved.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If MsgBox("Are you sure you want to approve this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub
    
    cn.Execute ("UPDATE VOUCHER SET dUpdated = GETDATE () WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")

    UpdateLogFile "Voucher", Trim(txtVoucherNo), "Approved"

    UpdateGLA "Update", "VOU", Trim(txtVoucherNo)
    
    cn.Execute ("UPDATE VOUCHER SET lApproved = 1 WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")
    
    If rsNonTrade.RecordCount <> 0 Then
       UpdateFixedAsset
    End If
    
    sbRS.Panels(5) = "APPROVED"
    Mode = Normal
    
    rsHeader!lApproved = True
    rsHeader.UpdateBatch adAffectAll

TheSource:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

Sub UpdateFixedAsset()
    
    sSQL = "SELECT cAssetNo, nValue, dDate FROM VOUCHER_NonTrade WHERE cCompanyID = '" & COID & "' " & _
            "AND cTranNo = '" & Trim(txtVoucherNo) & "'"
    Set rs = New Recordset
    rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
    Do Until rs.EOF
        cn.Execute ("UPDATE ASSET SET dDate = '" & Trim(rs!dDate) & "', nValue = '" & rs!nValue & "', " & _
                    " nDepre = " & rs!nValue & "/nLife, nBook = '" & rs!nValue & "' " & _
                    "WHERE cCompanyID = '" & COID & "' AND cAssetNo = '" & rs!cAssetNo & "'")
        rs.MoveNext
    Loop
    Set rs = Nothing

End Sub

Public Sub TBCancelRecord()
On Error GoTo ErrorHandler
    
    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled.", vbExclamation, msgTtl
        Exit Sub
    ElseIf rsHeader!lApproved = True Then
        MsgBox "Cannot cancel approved transaction.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If MsgBox("Are you sure you want to cancel this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub

    cn.Execute ("UPDATE VOUCHER SET dUpdated = GETDATE () WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")

    UpdateLogFile "VOUCHER", Trim(txtVoucherNo), "Cancelled"
    
    UpdateGLA "Delete", "VOU", Trim(txtVoucherNo)

    cn.Execute ("UPDATE VOUCHER SET lCancelled = 1 WHERE cTranNo = '" & Trim(txtVoucherNo) & "' AND cCompanyID = '" & COID & "'")
    
    sbRS.Panels(5) = "CANCELLED"
    Mode = Normal
    
    rsHeader!lCancelled = True
    rsHeader.UpdateBatch adAffectAll

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Public Sub TBPrintRecord()
    If Trim(txtVoucherNo) = "" Then Exit Sub
    cTypeVoucher = Trim(txtType.Text)
    cModule = "BasicVoucher"
    oPrint.PrintReceipt Trim(txtVoucherNo)
End Sub

Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgList.DataSource = rsHeader
    Set dtgNonTrade.DataSource = rsNonTrade
    Set dtgOPEX.DataSource = rsOPEX
    Set dtgPayment.DataSource = rsPayment
    Set dtgTrade.DataSource = rsTrade
    
End Sub

Sub SetDataField()
    With rsHeader
        txtVoucherNo.DataField = !cTranNo
        dtbDate.DataField = !dDate
        txtType.DataField = !cType
        txtCode.DataField = !cCode
        txtName.DataField = !cName
        txtAddress.DataField = !cAddress
        txtPaymentFor.DataField = !cSpec
        txtRemarks.DataField = !cRemarks
        txtDebit.DataField = !nTDebit
        txtCredit.DataField = !nTCredit
        chkRFP.DataField = !lRFP
        txtRFPNo.DataField = !cRFPNo
        ITGdSigDate1.DataField = !dSigDate1
        ITGcSigRmks1.DataField = !cSigRmks1
        ITGdSigGrpDate2.DataField = !dSigGrpDate2
        ITGcSigGrpRmks2.DataField = !cSigGrpRmks2
        ITGdSigUntDate2.DataField = !dSigUntDate2
        ITGcSigUntRmks2.DataField = !cSigUntRmks2
        ITGdRlsGrpDate.DataField = !dRlsGrpDate
        ITGcRlsGrpRmks.DataField = !cRlsGrpRmks
        ITGdRlsUntDate.DataField = !dRlsUntDate
        ITGcRlsUntRmks.DataField = !cRlsUntRmks
        ITGdOnHoldDate.DataField = !dOnHoldDate
        ITGcOnHoldRmks.DataField = !cOnHoldRmks
        ITGdCancelledDate.DataField = !dCancelledDate
        ITGcCancelledRmks.DataField = !cCancelledRmks
        ITGdAuditDate.DataField = !dAuditDate
        ITGcAuditRmks.DataField = !cAuditRmks
        ITGdVouRlsDate.DataField = !dVouRlsdDate
        ITGcVouRlsRmks.DataField = !cVouRlsdRmks
        ITGdLiquidationDate.DataField = !dLiquidationDate
        ITGcLiquidationRmks.DataField = !cLiquidationRmks
        ITGdVouRtrndDate.DataField = !dVouRtrndDate
        ITGcVouRtrndRmks.DataField = !cVouRtrndRmks
        txtEVAT.DataField = !nEVAT
        txtEWT.DataField = !nEWT
        txtProject.DataField = !cProjectID
        txtWork.DataField = !cWorkID
    End With
End Sub


Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler

    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        'Status bar setup
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount

        If rsHeader.Status <> adRecNew Then
            txtVoucherNo.Locked = True
        Else
            txtVoucherNo.Locked = False
        End If

        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else
            sbRS.Panels(2) = ""
        End If
        
        GetChild
    
        If rsHeader!lCancelled = True Then
            sbRS.Panels(5) = "CANCELLED"
        ElseIf rsHeader!lApproved = True Then
            sbRS.Panels(5) = "APPROVED"
        Else
            sbRS.Panels(5) = ""
        End If
    
    Else
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtVoucherNo.Locked = False
    End If

    If Mode = AddNewEdit Then
        dtgNonTrade.Refresh
        dtgOPEX.Refresh
        dtgPayment.Refresh
        dtgTrade.Refresh
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab1.TabEnabled(1) = False
    Else
        SSTab1.TabEnabled(1) = True
    End If
End Sub

Private Sub txtCode_Change()
    If Mode <> AddNewEdit Then Exit Sub
    txtName = ""
    If txtType = "Trade" Then
        txtName = GetValueFrTable("cName", "CLIENT_SUPPLIER", "cCode = '" & Trim(txtCode) & "'")
        rsHeader!cAddress = GetAddress("CLIENT_SUPPLIER", "cCode = '" & Trim(txtCode) & "'") & ""
    ElseIf txtType = "Non-Trade" Then
        txtName = GetValueFrTable("cName", "CLIENT_SUPPLIER_NT", "cCode = '" & Trim(txtCode) & "'")
        If txtName = "" Then
            txtName = GetValueFrTable("cName", "CLIENT_SUPPLIER", "cCode = '" & Trim(txtCode) & "'")
            rsHeader!cAddress = GetAddress("CLIENT_SUPPLIER", "cCode = '" & Trim(txtCode) & "'") & ""
        Else: rsHeader!cAddress = GetAddress("CLIENT_SUPPLIER_NT", "cCode = '" & Trim(txtCode) & "'") & ""
        End If
    ElseIf txtType = "Others" Then
        txtName = GetValueFrTable("cEmpName", "EMPLOYEE", "cEmpCode = '" & Trim(txtCode) & "'")
        rsHeader!cAddress = GetAddress("EMPLOYEE", "cEmpCode = '" & Trim(txtCode) & "'") & ""
    End If
End Sub

Private Sub txtRFPNo_Change()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtRFPNo) <> "" Then
    
        sSQL = "SELECT cTranNo FROM RFP WHERE cCompanyID = '" & COID & "' " & _
                    " and cCode = '" & Trim(txtCode) & "' and cTranNo ='" & Trim(txtRFPNo) & "'and cTranNo not in (select cRFPNo from VOUCHER where " & _
                    " cCompanyID = '" & COID & "' and cCode = '" & RepName & "' and cRFPNo is not null)"
        Set rs = Nothing
        Set rs = New ADODB.Recordset
        
        rs.Open sSQL, cn, adOpenKeyset, adLockReadOnly
        
        If rs.RecordCount = 0 Then
            cmdPickRFP_Click
        Else
            AddDetailsFromRFP (Trim(txtRFPNo))
        End If
    Else
        If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
            Do Until rsTrade.EOF
                rsTrade.Delete
                rsTrade.MoveNext
            Loop
            
        If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
            Do Until rsNonTrade.EOF
                rsNonTrade.Delete
                rsNonTrade.MoveNext
            Loop
            
        If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
            Do Until rsOPEX.EOF
                rsOPEX.Delete
                rsOPEX.MoveNext
            Loop
    End If
End Sub

Private Sub txtRFPNo_LostFocus()
If Mode <> AddNewEdit Then Exit Sub
    If chkRFP.Value = Checked Then
        If Trim(txtRFPNo) = "" Then
            If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
                Do Until rsTrade.EOF
                    rsTrade.Delete
                    rsTrade.MoveNext
                Loop
                
            If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
                Do Until rsNonTrade.EOF
                    rsNonTrade.Delete
                    rsNonTrade.MoveNext
                Loop
                
            If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
                Do Until rsOPEX.EOF
                    rsOPEX.Delete
                    rsOPEX.MoveNext
                Loop
        Else
            txtRFPNo_Change
        End If
    End If
End Sub

Private Sub txtType_Change()
    If Trim(txtType) <> "" Or txtType <> vbNullString Then
        cboType = Trim(txtType)
    Else
        cboType.ListIndex = -1
    End If
    
    
    
    If Mode = AddNewEdit Then
        txtCode = ""
        If rsHeader!cType = "Trade" Then
            SSTab2.TabEnabled(0) = False
            SSTab2.TabEnabled(1) = True
            SSTab2.TabEnabled(2) = False
            SSTab2.ActiveTab = 1
            If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
            Do Until rsNonTrade.EOF
                rsNonTrade.Delete
                rsNonTrade.MoveNext
            Loop
        ElseIf rsHeader!cType = "Non-Trade" Then
            SSTab2.TabEnabled(0) = False
            SSTab2.TabEnabled(1) = False
            SSTab2.TabEnabled(2) = True
            SSTab2.ActiveTab = 2
            Do Until rsNonTrade.EOF
                rsNonTrade.Delete
                rsNonTrade.MoveNext
            Loop
        ElseIf rsHeader!cType = "Others" Then
            SSTab2.TabEnabled(0) = True
            SSTab2.TabEnabled(1) = False
            SSTab2.TabEnabled(2) = False
            SSTab2.ActiveTab = 0
            Do Until rsNonTrade.EOF
                rsNonTrade.Delete
                rsNonTrade.MoveNext
            Loop
        End If
    End If
    
End Sub

Private Sub txtVoucherNo_LostFocus()
    If Mode = AddNewEdit Then
        If Trim(txtVoucherNo) = "" Then
            MsgBox "Empty primary input.", vbInformation, msgTtl
            If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
            txtVoucherNo.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtVoucherNo = Trim(txtVoucherNo)
            If IDExisting(rsHeader, "cTranNo", "VOUCHER", Trim(rsHeader!cTranNo)) Then
                MsgBox "Transaction No. already exist.", vbInformation, msgTtl
                If FrmName.Name <> Me.Name Then PreviousTab frmComUnionMenuTab
                txtVoucherNo.SetFocus
            End If
        End If
    End If
End Sub

Function MandatoryOK() As Boolean

    MandatoryOK = True

    If Trim(txtVoucherNo) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Transaction Number' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        txtVoucherNo.SetFocus
        Exit Function
    End If
    
    ComputeTotal
    
    If rsHeader.Status = adRecNew And lSystemGenerated = False Then
        If IDExisting(rsHeader, "cTranNo", "VOUCHER", Trim(rsHeader!cTranNo)) Then
            MandatoryOK = False
            MsgBox "Transaction No. already exist.", vbInformation, msgTtl
            txtVoucherNo.SetFocus
            Exit Function
        End If
    End If

    If Trim(dtbDate.Text) = "__/__/____" Then
        MandatoryOK = False
        MsgBox "Field 'Transaction Date' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        dtbDate.SetFocus
        Exit Function
    ElseIf Trim(txtType) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Type' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        cboType.SetFocus
        Exit Function
    ElseIf Trim(txtName) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Name' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        txtName.SetFocus
        Exit Function
    End If
    
    GetChild
    
    If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
    Do Until rsNonTrade.EOF
        If rsNonTrade.Status = (adRecNew) Or rsNonTrade.Status = (adRecModified) Then
            If IsNull(rsNonTrade!cTranNo) Then
                rsNonTrade.Delete
            ElseIf Trim(rsNonTrade!cTranNo) = "" Then
                rsNonTrade.Delete
            Else
                rsNonTrade.MoveNext
            End If
        Else
            rsNonTrade.MoveNext
        End If
    Loop

    If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
    Do Until rsOPEX.EOF
        If rsOPEX.Status = (adRecNew) Or rsOPEX.Status = (adRecModified) Then
            If IsNull(rsOPEX!cAcctNo) Then
                rsOPEX.Delete
            ElseIf Trim(rsOPEX!cAcctNo) = "" Then
                rsOPEX.Delete
            Else
                rsOPEX.MoveNext
            End If
        Else
            rsOPEX.MoveNext
        End If
    Loop
    
    
    If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
    Do Until rsTrade.EOF
        If rsTrade.Status = (adRecNew) Or rsTrade.Status = (adRecModified) Then
            If IsNull(rsTrade!cPINo) Then
                rsTrade.Delete
            ElseIf Trim(rsTrade!cPINo) = "" Then
                rsTrade.Delete
            Else
                rsTrade.MoveNext
            End If
        Else
            rsTrade.MoveNext
        End If
    Loop
    
    If rsPayment.RecordCount <> 0 Then rsPayment.MoveFirst
    Do Until rsPayment.EOF
        If rsPayment.Status = (adRecNew) Or rsPayment.Status = (adRecModified) Then
            If IsNull(rsPayment!cType) Then
                rsPayment.Delete
            ElseIf Trim(rsPayment!cType) = "" Then
                rsPayment.Delete
            ElseIf rsPayment!nAmount = 0 Then
                rsPayment.Delete
            Else
                rsPayment.MoveNext
            End If
        Else
            rsPayment.MoveNext
        End If
    Loop
    
    GetChild
    
    If rsPayment.RecordCount <> 0 Then
        rsPayment.MoveFirst
        Do Until rsPayment.EOF
            rsPayment!nIdentity = rsPayment.AbsolutePosition
            rsPayment.MoveNext
        Loop
    End If

    If rsNonTrade.RecordCount <> 0 Then
        rsNonTrade.MoveFirst
        Do Until rsNonTrade.EOF
            rsNonTrade!nIdentity = rsNonTrade.AbsolutePosition
            rsNonTrade.MoveNext
        Loop
    End If
    
    
    If rsTrade.RecordCount <> 0 Then
        rsTrade.MoveFirst
        Do Until rsTrade.EOF
            rsTrade!nIdentity = rsTrade.AbsolutePosition
            rsTrade.MoveNext
        Loop
    End If
    
    If rsOPEX.RecordCount <> 0 Then
        rsOPEX.MoveFirst
        Do Until rsOPEX.EOF
            rsOPEX!nIdentity = rsOPEX.AbsolutePosition
            rsOPEX.MoveNext
        Loop
    End If
    
    GetChild

    ComputeTotal
    
End Function

Private Sub GetChild()
    rsNonTrade.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rsOPEX.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rsPayment.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rsTrade.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
End Sub

Private Sub RSZero()
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    sbRS.Panels(4) = ""
    sbRS.Panels(5) = ""
    
    Set dtgNonTrade.DataSource = Nothing
    Set dtgOPEX.DataSource = Nothing
    Set dtgPayment.DataSource = Nothing
    Set dtgTrade.DataSource = Nothing
    dtgNonTrade.Refresh
    dtgOPEX.Refresh
    dtgPayment.Refresh
    dtgTrade.Refresh
    
    Set FrmName = Me
    UnbindControls
    TextClearing
    FormLocking True
    
    If rsHeader.State = adStateOpen Then rsHeader.Close
    If rsNonTrade.State = adStateOpen Then rsNonTrade.Close
    If rsOPEX.State = adStateOpen Then rsOPEX.Close
    If rsPayment.State = adStateOpen Then rsPayment.Close
    If rsTrade.State = adStateOpen Then rsTrade.Close
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    
    txtVoucherNo.Locked = False
    txtVoucherNo.SetFocus
    
    Mode = Find
    
End Sub

Sub SearchObj(lEnable As Boolean)
    dtbDate.Enabled = lEnable
    cboType.Enabled = lEnable
    cmdPickClient.Enabled = lEnable
    cmdPickRFP.Enabled = lEnable
    cmdPickProject.Enabled = lEnable
    cmdPickWork.Enabled = lEnable
End Sub

Sub ComputeTotal()
    TotalOPEX
    TotalNonTrade
    TotalTrade
    TotalPayment
    TotalAmount
End Sub

Public Sub AddDetailsFromList(InvNo As String, InvDate As String, InvBalance As Double, nEWTRATE As Double)
    
    If dtgName = dtgTrade.Name Then
        With rsTrade
            !cPINo = Trim(InvNo)
            !dDate = Trim(InvDate)
            !nAmount = InvBalance
            !nApplied = InvBalance
            !nEWT = nEWTRATE
            dtgTrade.Col = 3
            dtgTrade.Columns(3).Value = !nApplied '- !nEWT
            
            dtgTrade.Col = 4
            dtgTrade.Columns(4).Value = !nEWT
            
            'dtgTrade.Columns(3).Value = !n
        End With
    End If
    
End Sub

Sub TotalOPEX()
Dim nDebit, nCredit As Double
    
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    nDebit = 0
    nCredit = 0
    Set rs = New Recordset
    Set rs = rsOPEX.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        nDebit = nDebit + rs!nDebit
        nCredit = nCredit + rs!nCredit
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    nOPEXDebit = nDebit
    nOPEXCredit = nCredit
    
End Sub

Sub TotalNonTrade()
Dim n As Double
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    n = 0
    Set rs = New Recordset
    Set rs = rsNonTrade.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        n = n + rs!nApplied
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    nNonTrade = n
    
End Sub

Sub TotalTrade()
Dim n As Double
    
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    n = 0
    Set rs = New Recordset
    Set rs = rsTrade.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        n = n + rs!nApplied
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    nTrade = n
    
End Sub

Sub TotalPayment()
Dim n As Double
    
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    n = 0
    Set rs = New Recordset
    Set rs = rsPayment.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        n = n + rs!nAmount
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    nPayment = n
    
End Sub

Sub TotalAmount()
    rsHeader!nTCredit = IIf(IsNull(nOPEXCredit), 0, nOPEXCredit) + IIf(IsNull(nPayment), 0, nPayment)
    rsHeader!nTDebit = IIf(IsNull(nOPEXDebit), 0, nOPEXDebit) + IIf(IsNull(nNonTrade), 0, nNonTrade) + _
            IIf(IsNull(nTrade), 0, nTrade) + IIf(IsNull(nTPC), 0, nTPC)
End Sub


Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtVoucherNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cTranno LIKE '" & Trim$(txtVoucherNo.Text) & "%'"
    End If

    If Trim$(dtbDate.Text) <> "__/__/____" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " dDate = '" & Trim$(dtbDate.Text) & "'"
    End If
    
    If Trim$(txtType.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cType LIKE '" & Trim$(txtType.Text) & "%'"
    End If
    
    If Trim$(txtCode.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cCode LIKE '" & Trim$(txtCode.Text) & "%'"
    End If
    
    If Trim$(txtRFPNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cRFPNo LIKE '" & Trim$(txtRFPNo.Text) & "%'"
    End If
    
    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

Sub ChangeTranNo(strTranNo As String)
    GetChild
    
    rsHeader!cTranNo = strTranNo
        If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
        Do Until rsOPEX.EOF
            rsOPEX!cTranNo = strTranNo
            rsOPEX.MoveNext
        Loop
        If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
        Do Until rsNonTrade.EOF
            rsNonTrade!cTranNo = strTranNo
            rsNonTrade.MoveNext
        Loop
        
        If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
        Do Until rsTrade.EOF
            rsTrade!cTranNo = strTranNo
            rsTrade.MoveNext
        Loop
    
    GetChild
End Sub

Sub EnableStatusControls()
    ITGdSigDate1.Enabled = True
    ITGcSigRmks1.Locked = False
    ITGdSigGrpDate2.Enabled = True
    ITGcSigGrpRmks2.Locked = False
    ITGdSigUntDate2.Enabled = True
    ITGcSigUntRmks2.Locked = False
    ITGdRlsGrpDate.Enabled = True
    ITGcRlsGrpRmks.Locked = False
    ITGdRlsUntDate.Enabled = True
    ITGcRlsUntRmks.Locked = False
    ITGdOnHoldDate.Enabled = True
    ITGcOnHoldRmks.Locked = False
    ITGdCancelledDate.Enabled = True
    ITGcCancelledRmks.Locked = False
    ITGdAuditDate.Enabled = True
    ITGcAuditRmks.Locked = False
    ITGdVouRlsDate.Enabled = True
    ITGcVouRlsRmks.Locked = False
    ITGdLiquidationDate.Enabled = True
    ITGcLiquidationRmks.Locked = False
    ITGdVouRtrndDate.Enabled = True
    ITGcVouRtrndRmks.Locked = False
End Sub

Sub UpdateStatus()
    rsHeader.UpdateBatch adAffectAll
End Sub

Sub AddToEWTTable()
Dim cmdToEWT As ADODB.Command

    Set cmdToEWT = New ADODB.Command
    With cmdToEWT
        .ActiveConnection = cn
        .CommandTimeout = 1000
        .CommandText = "SP_InsertEWTFromVoucher"
        .CommandType = adCmdStoredProc
        .Parameters("@cCompanyID") = COID
        .Parameters("@cTranNo") = Trim(txtVoucherNo)
        .Execute
    End With
    Set cmdToEWT = Nothing

End Sub

Sub AddToEVATTable()
Dim cmdToEVAT As ADODB.Command

    Set cmdToEVAT = New ADODB.Command
    With cmdToEVAT
        .ActiveConnection = cn
        .CommandTimeout = 1000
        .CommandText = "SP_InsertEVATFromVoucher"
        .CommandType = adCmdStoredProc
        .Parameters("@cCompanyID") = COID
        .Parameters("@cTranNo") = Trim(txtVoucherNo)
        .Execute
    End With
    Set cmdToEVAT = Nothing

End Sub

Sub AutoDM()
Dim cmdAutoCM As ADODB.Command

    Set cmdAutoCM = New ADODB.Command
    With cmdAutoCM
        .ActiveConnection = cn
        .CommandTimeout = 1000
        .CommandText = "SP_InsertDMFromVoucher"
        .CommandType = adCmdStoredProc
        .Parameters("@cCompanyID") = COID
        .Parameters("@cTranNo") = Trim(txtVoucherNo)
        .Execute
    End With
    Set cmdAutoCM = Nothing
    
    UpdateGLA "Update", "AP", "E-" & Trim(txtVoucherNo)

End Sub

Sub ComputeEVATEWTTotalNonTrade()
Dim nEWT, nEVAT As Double
    
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    nEWT = 0
    nEVAT = 0
    
    Set rs = New Recordset
    Set rs = rsNonTrade.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        nEWT = nEWT + IIf(IsNull(rs!nEWT), 0, rs!nEWT)
        nEVAT = nEVAT + IIf(IsNull(rs!nEVAT), 0, rs!nEVAT)
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    rsHeader!nEWT = nEWT
    rsHeader!nEVAT = nEVAT

End Sub

Sub ComputeEVATEWTTotal()
Dim nEWT, nEVAT As Double
    
On Error Resume Next
    
    If Mode <> AddNewEdit Then Exit Sub
    
    nEWT = 0
    nEVAT = 0
    
    Set rs = New Recordset
    Set rs = rsTrade.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"

    rs.MoveFirst
    Do Until rs.EOF
        nEWT = nEWT + IIf(IsNull(rs!nEWT), 0, rs!nEWT)
        nEVAT = nEVAT + IIf(IsNull(rs!nEVAT), 0, rs!nEVAT)
        rs.MoveNext
    Loop
    Set rs = Nothing
    
    rsHeader!nEWT = nEWT
    rsHeader!nEVAT = nEVAT

End Sub

Sub AddDetailsFromRFP(sTranNo As String)
Dim rsCTrade As New ADODB.Recordset
Dim rsCNonTrade As New ADODB.Recordset
Dim rsCOpex  As New ADODB.Recordset

    Set rsCTrade = Nothing
    Set rsCNonTrade = Nothing
    Set rsCOpex = Nothing
            
    If rsTrade.RecordCount <> 0 Then rsTrade.MoveFirst
        Do Until rsTrade.EOF
            rsTrade.Delete
            rsTrade.MoveNext
        Loop
        
    If rsNonTrade.RecordCount <> 0 Then rsNonTrade.MoveFirst
        Do Until rsNonTrade.EOF
            rsNonTrade.Delete
            rsNonTrade.MoveNext
        Loop
        
    If rsOPEX.RecordCount <> 0 Then rsOPEX.MoveFirst
        Do Until rsOPEX.EOF
            rsOPEX.Delete
            rsOPEX.MoveNext
        Loop
            
    rsCTrade.Open "SELECT * FROM RFP_TRADE WHERE cTranNo = '" & Trim(sTranNo) & "' and cCompanyID= '" & COID & "'", cn, adOpenKeyset, adLockReadOnly
    If rsCTrade.RecordCount <> 0 Then rsCTrade.MoveFirst
    Do Until rsCTrade.EOF
        With rsTrade
            .AddNew
            !cTranNo = rsHeader!cTranNo
            !cCompanyID = COID
            !cWRRNo = rsCTrade!cInvNo
            !dDate = rsCTrade!dDate
            !nAmount = rsCTrade!nAmount
            !nApplied = rsCTrade!nApplied
            !nEWT = 0
            !nEVAT = 0
        End With
        rsCTrade.MoveNext
    Loop
    Set rsCTrade = Nothing
    
    rsCNonTrade.Open "SELECT * FROM RFP_NONTRADE WHERE cTranNo = '" & Trim(sTranNo) & "' and cCompanyID= '" & COID & "'", cn, adOpenKeyset, adLockReadOnly
    If rsCNonTrade.RecordCount <> 0 Then rsCNonTrade.MoveFirst
    Do Until rsCNonTrade.EOF
        With rsNonTrade
            .AddNew
            !cTranNo = rsHeader!cTranNo
            !cCompanyID = COID
            !cPayableID = rsCNonTrade!cPayableID
            !dDate = rsCNonTrade!dDate
            !nAmount = rsCNonTrade!nAmount
            !nApplied = rsCNonTrade!nApplied
            !nEWT = rsCNonTrade!nEWT
            !nEVAT = rsCNonTrade!nEVAT
        End With
        rsCNonTrade.MoveNext
    Loop
    Set rsCNonTrade = Nothing
    
    
    rsCOpex.Open "SELECT * FROM RFP_OPEX WHERE cTranNo = '" & Trim(sTranNo) & "' and cCompanyID= '" & COID & "'", cn, adOpenKeyset, adLockReadOnly
    If rsCOpex.RecordCount <> 0 Then rsCOpex.MoveFirst
    Do Until rsCOpex.EOF
        With rsOPEX
            .AddNew
            !cTranNo = rsHeader!cTranNo
            !cCompanyID = COID
            !cType = rsCOpex!cType
            !cAcctNo = rsCOpex!cAcctNo
            !cTitle = rsCOpex!cTitle
            !cDesc = rsCOpex!cDesc
            !nDebit = rsCOpex!nDebit
            !nCredit = rsCOpex!nCredit
        End With
        rsCOpex.MoveNext
    Loop
    Set rsCOpex = Nothing
End Sub

Sub UpdateCheckBooklet()
Dim sNewCurrent As String

If rsPayment.RecordCount <> 0 Then rsPayment.MoveFirst
    Do Until rsPayment.EOF
        If rsPayment!cType = "CHK" Then
            sNewCurrent = CStr(CDbl(Trim(rsPayment!cCheckNo)) + 1)
            cn.Execute ("UPDATE BANKCHECK SET cCheckCurrent = '" & sNewCurrent & "' WHERE cBankID = '" & Trim(rsPayment!cBankID) & "' AND cCheckBookNo = '" & Trim(rsPayment!cCheckBookno) & "'")
        End If
        rsPayment.MoveNext
    Loop
End Sub

Private Function InsertIntoIssued() As Boolean
On Error GoTo FunctionExit
Dim rsIssued As New ADODB.Recordset
Dim rsIssued_T As New ADODB.Recordset

    InsertIntoIssued = False
    OpenRecordset rsIssued, "*", "ISSUED", "WHERE 1 = 0"
    OpenRecordset rsIssued_T, "*", "ISSUED_T", "WHERE 1 = 0"
    
    If rsPayment.RecordCount <> 0 Then rsPayment.MoveFirst
    Do Until rsPayment.EOF
        If rsPayment!cType = "CHK" Then
            cn.Execute ("DELETE ISSUED WHERE cCompanyID = '" & COID & "' AND cCheckNo = '" & Trim(rsPayment!cCheckNo) & "' and cBankID ='" & Trim(rsPayment!cBankID) & "'")
            cn.Execute ("DELETE ISSUED_T WHERE cCompanyID = '" & COID & "' AND cCheckNo = '" & Trim(rsPayment!cCheckNo) & "' and cBankID ='" & Trim(rsPayment!cBankID) & "'")
            
            With rsIssued
                .AddNew
                !cCompanyID = COID
                !dDate = Trim(rsHeader!dDate)
                !cCheckNo = Trim(rsPayment!cCheckNo)
                !cBankID = Trim(rsPayment!cBankID)
                !cCheckBookno = Trim(rsPayment!cCheckBookno)
                !dCheckDate = Trim(rsPayment!dCheckDate)
                !nAmount = rsPayment!nAmount
                !nApplied = rsPayment!nAmount
            End With
            
            With rsIssued_T
                .AddNew
                !cCompanyID = COID
                !cCheckNo = Trim(rsPayment!cCheckNo)
                !cBankID = Trim(rsPayment!cBankID)
                !cVoucherNo = Trim(rsPayment!cTranNo)
                !dDate = Trim(rsHeader!dDate)
                !nAmount = rsPayment!nAmount
                !nApplied = rsPayment!nAmount
            End With
            
        End If
        rsPayment.MoveNext
    Loop
    
    rsIssued.UpdateBatch adAffectAll
    rsIssued_T.UpdateBatch adAffectAll
    
    Set rsIssued = Nothing
    Set rsIssued_T = Nothing
    
    InsertIntoIssued = True
FunctionExit:
    Exit Function
End Function
Sub tabshow()
If Mode = Normal Then
        If rsHeader!cType = "Trade" Then
            SSTab2.TabEnabled(0) = False
            SSTab2.TabEnabled(1) = True
            SSTab2.TabEnabled(2) = False
            SSTab2.ActiveTab = 1
        ElseIf rsHeader!cType = "Non-Trade" Then
            SSTab2.TabEnabled(0) = False
            SSTab2.TabEnabled(1) = False
            SSTab2.TabEnabled(2) = True
            SSTab2.ActiveTab = 2
        ElseIf rsHeader!cType = "Others" Then
            SSTab2.TabEnabled(0) = True
            SSTab2.TabEnabled(1) = False
            SSTab2.TabEnabled(2) = False
            SSTab2.ActiveTab = 0
        End If
    End If
End Sub


Public Sub ShowForm(sTranNo As String)
    If Mode = Find Then


    OpenNewConnection connHeader
    OpenNewConnection connNonTrade
    OpenNewConnection connOPEX
    OpenNewConnection connPayment
    OpenNewConnection connTrade
    
    Set rsHeader = Nothing
    Set rsNonTrade = Nothing
    Set rsOPEX = Nothing
    Set rsPayment = Nothing
    Set rsTrade = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsNonTrade = New ADODB.Recordset
    Set rsOPEX = New ADODB.Recordset
    Set rsPayment = New ADODB.Recordset
    Set rsTrade = New ADODB.Recordset

    OpenRecordsetWithCN rsHeader, "*", "VOUCHER", connHeader, "WHERE cTranno = '" & Trim(sTranNo) & "'"
    OpenRecordsetWithCN rsNonTrade, "*", "VOUCHER_NonTrade", connNonTrade, "WHERE cTranno = '" & Trim(sTranNo) & "'"
    OpenRecordsetWithCN rsOPEX, "*", "VOUCHER_OPEX", connOPEX, "WHERE cTranno = '" & Trim(sTranNo) & "'"
    OpenRecordsetWithCN rsPayment, "*", "VOUCHER_PAYMENT", connPayment, "WHERE cTranno = '" & Trim(sTranNo) & "'"
    OpenRecordsetWithCN rsTrade, "*", "VOUCHER_TRADE", connTrade, "WHERE cTranno = '" & Trim(sTranNo) & "'"


        Set FrmName = Me
        FormLocking True

        If rsHeader.RecordCount = 0 Then
            FormWaitHide
            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
            RSZero
            FormSearch True
            SearchObj True
            Mode = Find
            Exit Sub
        End If
            SetDataSource
            SetDataField
            txtVoucherNo.BackColor = &HE0FFFF
            Mode = Normal
            BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True, True

            'BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True, True

    End If
End Sub


Private Sub txtProject_Change()
    txtProjectName = ""
    txtProjectName = GetValueFrTable("cProjectName", "Project_Maintenance", "cProjectNo = '" & Trim(txtProject) & "'")
End Sub


Private Sub txtProject_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtProject) = "" And Trim(txtProject) <> "" Then cmdPickProject_Click
End Sub

Private Sub cmdPickProject_Click()
    If lPickListActive Then Exit Sub
    sFilterString = Trim(txtProject)
    frmITGPicker.zType = QProject
    frmITGPicker.Condition = "where cCompanyID = '" & COID & "'"
    
    frmITGPicker.Show vbModal
    txtProject = frmITGPicker.zCode
    txtProjectName = frmITGPicker.zName
    If Trim(txtProjectName) <> "" Then SendKeys "{Tab}"
End Sub

Private Sub txtWork_Change()
    txtWorkDesc = ""
    If txtProject.Text = "" Then: txtProject.SetFocus: Exit Sub
    txtWorkDesc = GetValueFrTable("description", "Work_Maintenance_File", "workno = '" & Trim(txtWork) & "' ") 'and cProjectNo =  '" & Trim(txtProject) & "'")
End Sub


Private Sub cmdPickWork_Click()
    If lPickListActive Then Exit Sub
'    sFilterString = Trim(txtWork)
    frmITGPicker.zType = QWork
    frmITGPicker.Condition = "where cCompanyID = '" & COID & "'" ' and cProjectNo = '" & Trim(txtProject) & "'"
    
    frmITGPicker.Show vbModal
    txtWork = frmITGPicker.zCode
    txtWorkDesc = frmITGPicker.zName
    If Trim(txtWorkDesc) <> "" Then SendKeys "{Tab}"
End Sub


Private Sub txtWork_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtWork) = "" And Trim(txtWork) <> "" Then cmdPickWork_Click
End Sub
